<?php
namespace Mp\Service\Widget;

use Mp\Service\Common\Asset;

class Color extends Input{

	protected $symbol;

	protected $label = 'textarea';

	protected $value = '#000000';

	protected $js = [
		'static/mp/assets/plugins/spectrum/spectrum.js',
		'static/mp/assets/plugins/jscolor/jscolor.js',
	];

	protected $css = [
		'static/mp/assets/plugins/spectrum/spectrum.css',
	];

	protected $script ;

	protected $view = 'Mp::widgets.color';

	protected function _init($params){
		$this->symbol = 'color-'.str_random();
		$this->script = <<<SCRIPT
	
SCRIPT;
		Asset::js($this->js);
		Asset::css($this->css);
		Asset::script($this->script);
		$this->data = [
			'name' => $this->name, 
			'value' => $this->value,
			'symbol' => $this->symbol,
		];
	}

	
}